package com.bbx.taxi.client.Util;

import java.util.List;

import android.app.Activity;
import android.content.Context;

import com.baidu.mapapi.model.LatLng;
import com.bbx.api.sdk.model.passanger.CouponUsableBulid;
import com.bbx.api.sdk.model.passanger.OrderSubmitBuild;
import com.bbx.api.sdk.model.passanger.PriceBuild;
import com.bbx.api.sdk.model.passanger.Return.Elements;
import com.bbx.api.sdk.model.passanger.Return.CarType.CarData;
import com.bbx.taxi.client.Activity.Main.IMainContract;
import com.bbx.taxi.client.Bean.Attribute.MainAttribute.CjType;
import com.bbx.taxi.client.Task.CancelReasonListTask;
import com.bbx.taxi.client.Task.CouponCountTask;
import com.bbx.taxi.client.Task.MyActivityTask;
import com.bbx.taxi.client.Task.MyAddThanksTask;
import com.bbx.taxi.client.Task.MyBalanceTask;
import com.bbx.taxi.client.Task.MyCancelTask;
import com.bbx.taxi.client.Task.MyCarTypeTask;
import com.bbx.taxi.client.Task.MyCodeTask;
import com.bbx.taxi.client.Task.MyCouponUsableTask;
import com.bbx.taxi.client.Task.MyLastPriceInfoTask;
import com.bbx.taxi.client.Task.MyLinePlusTask;
import com.bbx.taxi.client.Task.MyLineTask;
import com.bbx.taxi.client.Task.MyLocationInfoTask;
import com.bbx.taxi.client.Task.MyLoginTask;
import com.bbx.taxi.client.Task.MyMeteredFeeTask;
import com.bbx.taxi.client.Task.MyNearByDriverTask;
import com.bbx.taxi.client.Task.MyOrderPayTask;
import com.bbx.taxi.client.Task.MyOrderSubmitTask;
import com.bbx.taxi.client.Task.MyOrderWaitTask;
import com.bbx.taxi.client.Task.MyPriceAllTask;
import com.bbx.taxi.client.Task.MyPriceTask;
import com.bbx.taxi.client.Task.MyPushStatusTask;
import com.bbx.taxi.client.Task.MyRechargeTask;
import com.bbx.taxi.client.Task.MyShareDetailTask;
import com.bbx.taxi.client.Task.MyStartUpTask;
import com.bbx.taxi.client.Task.MySvconfigTask;
import com.bbx.taxi.client.Task.MyTuiJianTask;
import com.bbx.taxi.client.Task.MyUsableSaleTask;
import com.bbx.taxi.client.Task.MyUserTask;
import com.bbx.taxi.client.Task.OrderDetailTask;

/**
 * @Path com.bbx.taxi.client.Util.RequestUtils.java
 * @Author 严旭文
 * @Date 2016-8-24 上午9:18:17
 * @Company 蓝海（福建）信息技术有限公司
 * @Description 网络请求
 */
public class RequestUtils {
	/** 请求优惠劵数量 */
	public static void requestCouponCount(Activity context) {
		new CouponCountTask(context).request();
	}

	/** 活动请求 */
	public static void requestActivity(Activity context, String city) {
		new MyActivityTask(context, city).request();
	}

	/** 获取可用优惠劵 */
	public static void requestCouponUsable(Activity context,
			CouponUsableBulid mCouponUsableBulid,boolean isShow) {
		new MyCouponUsableTask(context, mCouponUsableBulid,isShow).request();
	}

	/** 获取用户消息 */
	public static void requestInfo(Activity context) {
		new MyUserTask(context).request();
	}

	/** 请求价格 */
	public static void requestPrice(Activity context, PriceBuild mPriceBuild,int view_id,
			CjType citype) {
		// TODO Auto-generated method stub
		new MyPriceTask(context, mPriceBuild,view_id,citype).request();
	}

	/** 城内城际所有线路价格(客户端使用) */
	public static void requestPriceAll(Activity context, List<Elements> elements,String appoint_time,int view_id,
			CjType citype) {
		new MyPriceAllTask(context, elements,appoint_time,view_id,citype).request();
	}

	/** 提交订单 */
	public static void requestOrderSubmit(Activity context,
			OrderSubmitBuild mOrderSubmitBuild) {
		new MyOrderSubmitTask(context, mOrderSubmitBuild).request();
	}

	/** 获取线路 */
	public static void requestLine(Activity context,boolean isShow) {
		new MyLineTask(context,isShow).request();
	}/** 获取线路Plus */
	public static void requestLinePlus(Activity context,boolean isShow) {
		new MyLinePlusTask(context,isShow).request();
	}

	/** 取消原因列表 */
	public static void requestCancelReasonList(Activity context) {
		new CancelReasonListTask(context).request();
	}

	/** 添加感谢费 */
	public static void requestAddThanks(Activity context, String order_id,
			int schedule_fee, String line_id, int order_type) {
		new MyAddThanksTask(context, order_id, schedule_fee, line_id,
				order_type).request();
	}

	/** 取消订单 */
	public static void requestCancel(Activity context, String order_id) {
		new MyCancelTask(context, order_id).request();
	}

	/** 获取位置信息 */
	public static void requestLocationInfo(Activity context, double lng,
			double lat, String province, String city) {
		new MyLocationInfoTask(context, lng, lat, province, city).request();
	}

	/** 获取附近的司机 */
	public static void requestNearByDriver(Activity context, String order_id,
			String line_id, double lng, double lat, double max_distance,
			boolean is1or2) {
		if (NetworkDetector.detect(context)) {
			new MyNearByDriverTask(context, order_id, line_id, lng, lat,
					max_distance, is1or2).request();
		}
	}
	/** 继续等待 */
	public static void requestWait(Activity context,String order_id) {
		new MyOrderWaitTask(context, order_id).request();
	}
	/** 获取市内订单被推送状态 */
	public static void requesPushStatus(Activity context,String order_id,String line_id) {
		new MyPushStatusTask(context, order_id,line_id).request();
	}
	/** 分享活动详情 */
	public static void requesShareDetail(Activity context, String share_type) {
		new MyShareDetailTask(context,share_type).request();
	}
	/** 订单详情 */
	public static void requesOrderDetail(Activity context,String order_id) {
		new OrderDetailTask(context,order_id).request();
	}
	/** 获取可用车型 */
	public static void requesCarType(Activity context,IMainContract.ViewMain mMainView,int order_type,LatLng start,LatLng end,String line_id,boolean isCity,int view_id,
			CjType citype) {
		new MyCarTypeTask(context,mMainView,order_type,start,end,line_id,isCity,view_id,citype).request();
	}
	/** 推荐上车点 */
	public static void requesTuiJian(Activity context,String lat,String lng,boolean isCity) {
		new MyTuiJianTask(context,lat,lng,isCity).request();
	}
	/** 市内跟包车的计价服务 */
	public static void requesMeteredFee(Activity context,CarData data,int type,int distance,int view_id,
			CjType citype) {
		new MyMeteredFeeTask(context,data,type,distance,view_id,citype).request();
	}
	/** 获取上次价格 */
	public static void requesLastPriceInfo(Activity context,String order_id,String line_id) {
		new MyLastPriceInfoTask(context, order_id,line_id).request();
	}
	/** 下单立减*/
	public static void requesUsableSale(Activity context,OrderSubmitBuild mOrderSubmitBuild) {
		new MyUsableSaleTask(context,mOrderSubmitBuild).request();
	}
	/** 乘客app启用/唤醒时调用(未登入用户不需要调用)*/
	public static void requesStartUp(Context context,String province) {
		new MyStartUpTask(context,province).request();
	}
	/** 余额查询*/
	public static void requesBalance(Activity context) {
		new MyBalanceTask(context).request();
	}
	/** 账号充值*/
	public static void requesRecharge(Activity context,MyRechargeTask.GATEWAY gateway,String amount) {
		new MyRechargeTask(context,gateway,amount).request();
	}
	/** 订单支付*/
	public static void requesOrderPay(Activity context,MyOrderPayTask.GATEWAY gateway,String order_id, String driver_id,int cashAmt) {
		new MyOrderPayTask(context,gateway,order_id,driver_id,cashAmt).request();
	}
	/** 获取验证码*/
	public static void requesCode(Activity context,String phone) {
		new MyCodeTask(context,phone).request();
	}
	/** 登陆*/
	public static void requesLogin(Activity context,String phone,String code,String recommend_code) {
		new MyLoginTask(context,phone,code,recommend_code).request();
	}
	/** 配置*/
	public static void requesSvconfig(Activity context) {
		new MySvconfigTask(context).request();
	}
}
